package com.example.service;

import com.example.pojo.Equipment;
import com.example.pojo.EquipmentOrder;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;


public interface EquipmentService {

    //查询所有器械
    List<Equipment> findAll();

    Equipment getById(@Param("equipmentId") Integer equipmentId);

    //根据 id 删除器械
    Boolean deleteByEquipmentId(Integer equipmentId);

    //添加器材
    Boolean insertEquipment(Equipment equipment);

    //根据 id 修改器械信息
    Boolean updateEquipmentByEquipmentId(Equipment equipment);

    //根据 id 查询器械
    List<Equipment> selectByEquipmentId(Integer equipmentId);

    //查询器械总数
    Integer selectTotalCount();

    /**
     * 查询空闲器材
     * @return
     */
    List<Equipment> findRelaxEquipment();

    Boolean insertEquipmentOrder(EquipmentOrder order);

    /**
     * 设置时间
     * @param useTime
     * @param equipmentOrderId
     * @return
     */
    int updateTime(Timestamp useTime, Integer equipmentOrderId);

    int updateStatus(Integer equipmentId);

    List<EquipmentOrder> getByUserId(@Param("equipmentId") Integer userId);

    void deleteOrderedEquipment(Integer equipmentId);
    int updateStatusAfterExit(Integer equipmentId);

    EquipmentOrder getOrder(Integer equipmentOrderId);
}
